<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
sdfsdf
</body>
</html>
<script>

    window.HuoZhongObj={
        name:"",
        getName:function(){
            return this.name;
        }
    };

    window.HuoZhongObj.name="nihao";

    if(window.HuoZhongObj === void 0)
    {
        alert("未定义");
    }else
    {
        alert("已经定义")
    }



</script>